﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="DeviceManage.aspx.cs" Inherits="DeviceManage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>无标题页</title>
    <link href="css/style.css" rel="stylesheet" type="text/css" />

    <script language="javascript" type="text/javascript">
        function seltime(inputName) {
            window.open('seltime.aspx?InputName=' + inputName + '', '', 'width=250,height=220,left=360,top=250,scrollbars=yes');
        }
        function SelectAll() {
            var e = document.getElementsByTagName("input");
            for (var i = 0; i < e.length; i++) {
                if (e[i].type == "checkbox") {
                    if (document.getElementById("selectall").checked == true)
                        e[i].checked = true;
                    else
                        e[i].checked = false;
                }
            }
        } 
    </script>

</head>
<body>
    <form method="post" id="frmAnnounce" runat="server">
    <table width="842" border="0" cellpadding="0" cellspacing="0" align="center">
        <tr style="color: blue; font-size: 14px;">
            <td style="height: 14px">
                <img src="images/list.gif" width="14px" height="14px" />设备管理--&gt;设备信息维护
            </td>
        </tr>
        <tr>
            <td style="height: 18px">
                窗口号：<asp:TextBox ID="txtWindowNumber" runat="server" Width="45px"></asp:TextBox>设备类别：<asp:DropDownList
                    ID="DeviceType" runat="server" Width="63px">
                </asp:DropDownList>
                <%--开始时间:<asp:TextBox ID="StartTime" runat="server" Width="65px"></asp:TextBox>
                <input class="submit" name="Button" onclick="seltime('StartTime')" style="width: 30px"
                    type="button" value="选择" />结束时间:<asp:TextBox ID="EndTime" runat="server" Width="64px"></asp:TextBox>
                <input class="submit" name="Button" onclick="seltime('EndTime')" style="width: 30px"
                    type="button" value="选择" />--%>
                所属部门：
                <asp:DropDownList ID="departmentName" runat="server" Width="63px">
                </asp:DropDownList>
                IP地址：<asp:TextBox ID="txtIPAddress" runat="server" Width="100px"></asp:TextBox>
                附加信息：<asp:TextBox ID="txtDeviceDemo" runat="server"></asp:TextBox>
                <asp:Button ID="Btn_Query" runat="server" OnClick="Btn_Query_Click" Text="查询" />
                <asp:Button ID="btnDel" runat="server" OnClick="btnDel_Click" Text="删除" OnClientClick="return confirm('您确认要删除该记录吗?');" /><br />
                <asp:GridView ID="GridView1" runat="server" AllowPaging="True" PageSize="20" AutoGenerateColumns="False"
                    BackColor="#DEBA84" BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px"
                    DataKeyNames="deviceId" CellPadding="3" CellSpacing="2" OnRowDataBound="GridView1_RowDataBound"
                    Width="842px" OnPageIndexChanging="GridView1_PageIndexChanging">
                    <FooterStyle BackColor="#6A5ACD" />
                    <RowStyle BackColor="#D6DFF7" ForeColor="#8C4510" />
                    <SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
                    <PagerStyle ForeColor="#FFFFFF" HorizontalAlign="Center" BackColor="#6A5ACD" />
                    <HeaderStyle BackColor="#799AE1" Font-Bold="True" />
                    <Columns>
                        <asp:TemplateField>
                            <HeaderTemplate>
                                <%--<asp:CheckBox ID="cbAll" runat="server" AutoPostBack="True" Text="全选" OnCheckedChanged="cbAll_CheckedChanged" />--%>
                                <input type="checkbox" id="selectall" onclick="SelectAll()">
                                <asp:Label ID="lb" runat="server">全选</asp:Label>
                            </HeaderTemplate>
                            <ItemTemplate>
                                <asp:CheckBox ID="cbox" runat="server" />
                            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Left" />
                            <HeaderStyle HorizontalAlign="Left" Width="50px" VerticalAlign="Top" />
                        </asp:TemplateField>
                        <asp:BoundField DataField="WindowNumber" HeaderText="窗口号" SortExpression="WindowNumber" />
                        <asp:BoundField DataField="deviceName" HeaderText="设备名称" SortExpression="deviceName" />
                        <asp:BoundField DataField="departmentName" HeaderText="所属部门" SortExpression="departmentName" />
                        <asp:BoundField DataField="deviceSerialNumber" HeaderText="设备序列号" SortExpression="deviceSerialNumber" />
                        <asp:BoundField DataField="deviceModel" HeaderText="设备型号" SortExpression="deviceModel" />
                        <asp:BoundField DataField="IPAddress" HeaderText="IP地址" SortExpression="IPAddress" />
                        <asp:HyperLinkField DataNavigateUrlFields="deviceId" DataNavigateUrlFormatString="DeviceUpdate.aspx?deviceId={0}"
                            HeaderText="详细" Text="&lt;img src='images/edit.gif' height=15 width=15 border=0&gt;详细" />
                    </Columns>
                </asp:GridView>
                &nbsp; &nbsp;
                <br />
                <asp:SqlDataSource ID="DeviceInfoDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
                    SelectCommand="SELECT [deviceSerialNumber], [deviceName], [departmentName], [deviceTypeName], [deviceModel],[deviceId],[IPAddress],[WindowNumber]  FROM [deviceInfoView]">
                </asp:SqlDataSource>
            </td>
        </tr>
    </table>
    </form>
</body>
</html>
